package com.hedl.elasticsearch.service;

import co.elastic.clients.elasticsearch.core.SearchResponse;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hedl.elasticsearch.pojo.Hotel;
import com.hedl.elasticsearch.pojo.HotelDoc;
import com.hedl.elasticsearch.pojo.PageResult;
import com.hedl.elasticsearch.pojo.RequestParams;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * @author Big Watermelon
 * @description
 * @date 2023/11/04/14:43
 */
public interface IHotelService extends IService<Hotel> {
    PageResult search(RequestParams requestParams) throws IOException;

    PageResult boolQuery(RequestParams requestParams) throws IOException;

    PageResult distanceSort(RequestParams requestParams) throws IOException;

    PageResult functionScore(RequestParams requestParams) throws IOException;

    Map<String, List<String>> filters(RequestParams requestParams) throws IOException;

    public Map<String, List<String>> bucketsResult(SearchResponse<HotelDoc> search,String ... fieldName);

    List<String> suggestion(String key) throws IOException;
}
